package com.rightsidetech.mall.mapper;


import com.rightsidetech.mall.dto.response.MallAgentCommodityResp;
import com.rightsidetech.mall.entity.MallAgentCommodity;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface MallAgentCommodityMapper {
    int deleteByPrimaryKey(Long id);

    int insert(MallAgentCommodity record);

    int insertSelective(MallAgentCommodity record);

    MallAgentCommodity selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(MallAgentCommodity record);

    int updateByPrimaryKey(MallAgentCommodity record);

    Long selectCountByCommodityIdAndAgentIds(Map<String, Object> map);

    Long selectCountByCommodityIdAndAgentId(@Param("commodityId") Long commodityId,@Param("agentId") Long agentId);

    int insertList(Map<String, Object> map);

    List<Long> selectCommodityIdByAgentId(Long agentId);

    MallAgentCommodity selectByCommodityIdAndAgentId(@Param("commodityId") Long commodityId,@Param("agentId") Long agentId);

    int deleteByCommodityId(@Param("commodityId") Long commodityId);

    int updateSortById(@Param("id") Long id,@Param("sort") Long sort);

    Byte selectCommodityStatus(@Param("agentId") Long agentId,@Param("commodityId") Long commodityId);

    List<MallAgentCommodity> selectByCommodityId(@Param("commodityId") Long commodityId);

    MallAgentCommodityResp selectById(Long id);

    List<MallAgentCommodity> selectByIds(@Param("agentId") Long agentId);
}